home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / gtaction.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-11-23  |  4.0 KB  |  112 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.  *   Copyright (C) 2004 by Riku Leino                                      *
  9.  *   tsoots@gmail.com                                                      *
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  *   This program is distributed in the hope that it will be useful,       *
  17.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  18.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  19.  *   GNU General Public License for more details.                          *
  20.  *                                                                         *
  21.  *   You should have received a copy of the GNU General Public License     *
  22.  *   along with this program; if not, write to the                         *
  23.  *   Free Software Foundation, Inc.,                                       *
  24.  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  25.  ***************************************************************************/
  26.  
  27. #ifndef GTACTION_H
  28. #define GTACTION_H
  29.  
  30. #include <QColor>
  31. #include <QTextCodec>
  32. #include <QMap>
  33. #include <QString>
  34.  
  35. class PageItem;
  36. class PrefsManager;
  37. class ScFace;
  38.  
  39. #include "gtfont.h"
  40. #include "gtframestyle.h"
  41. #include "gtparagraphstyle.h"
  42. #include "gtstyle.h"
  43. #include "scribusapi.h"
  44.  
  45. class CharStyle;
  46. class ParagraphStyle;
  47. class ScribusDoc;
  48. class ScribusMainWindow;
  49.  
  50. typedef QMap<QString, QString> FontFamilyMap;
  51.  
  52. class SCRIBUS_API gtAction
  53. {
  54. private:
  55.     ScribusMainWindow* m_ScMW;
  56.     PageItem *textFrame;
  57.     PageItem *it;
  58.     int lastParagraphStyle;
  59.     bool inPara;
  60.     bool isFirstWrite;
  61.     bool doAppend;
  62.     bool lastCharWasLineChange;
  63.     bool updateParagraphStyles;
  64.     /* If paragraph style is used should the font style of the gtpstyle be used 
  65.        or should writer respect the font set in the real paragraph style
  66.     */
  67.     bool overridePStyleFont;
  68.     QString currentFrameStyle;
  69.     FontFamilyMap families;
  70.  
  71.     int findParagraphStyle(const QString& name);
  72.     int findParagraphStyle(gtParagraphStyle* pstyle);
  73.     int applyParagraphStyle(gtParagraphStyle* pstyle);
  74.  
  75.     ScFace  validateFont(gtFont* font);
  76.     QString findFontName(gtFont* font);
  77.     void    updateParagraphStyle(int pstyleIndex, gtParagraphStyle* pstyle);
  78.     QString parseColor(const QString &s);
  79.     QColor  parseColorN(const QString &rgbColor);
  80.     void finalize();
  81.     PrefsManager *prefsManager;
  82. public:
  83. //    gtAction(bool append);
  84.     gtAction(bool append, PageItem *pageitem);
  85.     ~gtAction();
  86.     void setTextFrame(PageItem* frame);
  87.     void setProgressInfo();
  88.     void setProgressInfoDone();
  89.     void setInfo(QString infoText);
  90.     double getLineSpacing(int fontSize);
  91.     void clearFrame();
  92.     void getFrameFont(gtFont *font);
  93.     void getFrameStyle(gtFrameStyle *fstyle);
  94.     void write(const QString& text, gtStyle *style);
  95.     void writeUnstyled(const QString& text);
  96.     void applyFrameStyle(gtFrameStyle* fstyle);
  97.     void createParagraphStyle(gtParagraphStyle* pstyle);
  98.     void setCharStyleAttributes(gtFont *font, CharStyle& style);
  99.     void setParaStyleAttributes(gtParagraphStyle *gtstyle, ParagraphStyle& style);
  100.     void updateParagraphStyle(const QString& pstyleName, gtParagraphStyle* pstyle);
  101.     void removeParagraphStyle(const QString& name);
  102.     void removeParagraphStyle(int index);
  103.     double getFrameWidth();
  104.     QString getFrameName();
  105.     bool getUpdateParagraphStyles();
  106.     void setUpdateParagraphStyles(bool newUPS);
  107.     bool getOverridePStyleFont();
  108.     void setOverridePStyleFont(bool newOPSF);
  109. };
  110.  
  111. #endif
  112.